fix: include payable amount when zero and respect generateOnZero flag#12
Conversation
…zero amounts when generateOnZero is false
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThe PR updates monetary XML generation in Peppol UBL documents to correctly emit ChangesPayableAmount zero-value handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/helpers/isNullish.ts`:
- Around line 1-2: The isNullish function currently types its parameter as any;
change the parameter type to unknown to improve type safety while preserving the
type guard signature (export const isNullish = (value: unknown): value is null |
undefined => ...). Update the parameter type in the isNullish function
definition and keep the existing null/undefined checks so the runtime behavior
and the type predicate remain unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 704a6b34-3541-4aa5-8ba9-18960f0be3ce
📒 Files selected for processing (4)
src/builder/DocumentBuilder.tssrc/helpers/isNullish.tstests/builder-creditnote.test.tstests/builder-invoice.test.ts
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| BestPractice | 1 high |
🟢 Metrics 0 complexity · 0 duplication
Metric Results Complexity 0 Duplication 0
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This commit addresses an issue where zero payable amounts were not included correctly and ensures other zero amounts are omitted when the
generateOnZeroflag is set to false.